package com.suxin.plugin.pf4j.state;

import com.suxin.plugin.intergration.manager.PluginWrapper;
import com.suxin.plugin.intergration.manager.plugin.PluginManager;
import com.suxin.plugin.pf4j.PluginState;

import java.util.EventObject;

/**
 * @author Tang
 * @classname PluginStateEvent
 * @description [  ]
 * @date 2022/7/21 00:04
 */
public class PluginStateEvent extends EventObject {

    private PluginWrapper plugin;
    private PluginState oldState;

    public PluginStateEvent(PluginManager pluginManager, PluginState oldState, PluginWrapper plugin) {
        super(pluginManager);
        this.oldState = oldState;
        this.plugin = plugin;
    }

    public PluginWrapper getPlugin() {
        return plugin;
    }

    public PluginState getOldState() {
        return oldState;
    }

    @Override
    public Object getSource() {
        return super.getSource();
    }
}
